<!DOCTYPE html>
<html lang="en">
  <head>
    <title>
        Docker-3-常用软件安装 - rulerLwx Blog
      </title>
        <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-transform" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,adress=no">
    
    <meta name="theme-color" content="#000000" />
    
    <meta http-equiv="window-target" content="_top" />
    
    
    <meta name="description" content="Redis 1）拉取镜像 docker pull redis:5 2）启动容器 最简单的启动 docker run --name redis01 -p 6379:6379 -d redis:5 redis-server 复杂的启动：自定义配置文件 使用 -v 设置文件存储位置、redis配置文件位置，注意" />
    <meta name="generator" content="Hugo 0.73.0 with theme pure" />
    <title>Docker-3-常用软件安装 - rulerLwx Blog</title>
    
    
    <link rel="stylesheet" href="https://rulerLwx.gitee.io/css/style.min.c4bc7071f132c964c2116bca53b392933f377e5ca7b7051ed245187c621a2d3e.css">
    
    <link rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/9.15.10/styles/github.min.css" async>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.css" async>
    <meta property="og:title" content="Docker-3-常用软件安装" />
<meta property="og:description" content="Redis 1）拉取镜像 docker pull redis:5 2）启动容器 最简单的启动 docker run --name redis01 -p 6379:6379 -d redis:5 redis-server 复杂的启动：自定义配置文件 使用 -v 设置文件存储位置、redis配置文件位置，注意" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://rulerLwx.gitee.io/2020/07/docker-3-%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85/" />
<meta property="article:published_time" content="2020-07-01T18:58:47+08:00" />
<meta property="article:modified_time" content="2020-07-01T18:58:47+08:00" />
<meta itemprop="name" content="Docker-3-常用软件安装">
<meta itemprop="description" content="Redis 1）拉取镜像 docker pull redis:5 2）启动容器 最简单的启动 docker run --name redis01 -p 6379:6379 -d redis:5 redis-server 复杂的启动：自定义配置文件 使用 -v 设置文件存储位置、redis配置文件位置，注意">
<meta itemprop="datePublished" content="2020-07-01T18:58:47&#43;08:00" />
<meta itemprop="dateModified" content="2020-07-01T18:58:47&#43;08:00" />
<meta itemprop="wordCount" content="2567">



<meta itemprop="keywords" content="," /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Docker-3-常用软件安装"/>
<meta name="twitter:description" content="Redis 1）拉取镜像 docker pull redis:5 2）启动容器 最简单的启动 docker run --name redis01 -p 6379:6379 -d redis:5 redis-server 复杂的启动：自定义配置文件 使用 -v 设置文件存储位置、redis配置文件位置，注意"/>

    <!--[if lte IE 9]>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
      <![endif]-->

    <!--[if lt IE 9]>
        <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
      <![endif]-->
  </head>

  
  

  <body class="main-center theme-black" itemscope itemtype="http://schema.org/WebPage"><header class="header" itemscope itemtype="http://schema.org/WPHeader">
    <div class="slimContent">
      <div class="navbar-header">
        <div class="profile-block text-center">
          <a id="avatar" href="https://gitee.com/rulerLwx" target="_blank">
            <img class="img-circle img-rotate" src="https://rulerLwx.gitee.io/avatar.png" width="200" height="200">
          </a>
          <h2 id="name" class="hidden-xs hidden-sm">rulerLwx</h2>
          <h3 id="title" class="hidden-xs hidden-sm hidden-md">thinking...</h3>
          <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i>Guangzhou, China</small>
        </div><div class="search" id="search-form-wrap">
    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="Search" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i
                        class="icon icon-search"></i></button>
            </span>
        </div>
        <div class="ins-search">
            <div class="ins-search-mask"></div>
            <div class="ins-search-container">
                <div class="ins-input-wrapper">
                    <input type="text" class="ins-search-input" placeholder="Type something..."
                        x-webkit-speech />
                    <button type="button" class="close ins-close ins-selectable" data-dismiss="modal"
                        aria-label="Close"><span aria-hidden="true">×</span></button>
                </div>
                <div class="ins-section-wrapper">
                    <div class="ins-section-container"></div>
                </div>
            </div>
        </div>
    </form>
</div>
        <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>
      <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
        <ul class="nav navbar-nav main-nav">
            <li class="menu-item menu-item-home">
                <a href="/">
                    <i class="icon icon-home-fill"></i>
                  <span class="menu-title">Home</span>
                </a>
            </li>
            <li class="menu-item menu-item-archives">
                <a href="/posts/">
                    <i class="icon icon-archives-fill"></i>
                  <span class="menu-title">Archives</span>
                </a>
            </li>
            <li class="menu-item menu-item-categories">
                <a href="/categories/">
                    <i class="icon icon-folder"></i>
                  <span class="menu-title">Categories</span>
                </a>
            </li>
            <li class="menu-item menu-item-tags">
                <a href="/tags/">
                    <i class="icon icon-tags"></i>
                  <span class="menu-title">Tags</span>
                </a>
            </li>
            <li class="menu-item menu-item-about">
                <a href="/about/">
                    <i class="icon icon-cup-fill"></i>
                  <span class="menu-title">About</span>
                </a>
            </li>
        </ul>
      </nav>
    </div>
  </header>

<aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">Board</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">enjoy~
            </div>
        </div>
    </div>
</div>

      <div class="widget">
    <h3 class="widget-title"> Categories</h3>
    <div class="widget-body">
        <ul class="category-list">
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-framework/" class="category-list-link">java-framework</a><span class="category-list-count">38</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-front-end/" class="category-list-link">java-front-end</a><span class="category-list-count">11</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-se/" class="category-list-link">java-se</a><span class="category-list-count">21</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/java-senior/" class="category-list-link">java-senior</a><span class="category-list-count">4</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/linux/" class="category-list-link">linux</a><span class="category-list-count">13</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/tools/" class="category-list-link">tools</a><span class="category-list-count">1</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/%E6%8A%80%E6%9C%AF%E6%9D%82%E7%83%A9/" class="category-list-link">技术杂烩</a><span class="category-list-count">4</span></li>
            <li class="category-list-item"><a href="https://rulerLwx.gitee.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/" class="category-list-link">数据库</a><span class="category-list-count">15</span></li>
        </ul>
    </div>
</div>
      <div class="widget">
    <h3 class="widget-title"> Tags</h3>
    <div class="widget-body">
        <ul class="tag-list">
            
            
            <li class="tag-list-item"><a href="https://rulerLwx.gitee.io/tags/jvm/" class="tag-list-link">jvm</a><span
                    class="tag-list-count">1</span></li>
            
            
            <li class="tag-list-item"><a href="https://rulerLwx.gitee.io/tags/%E5%A4%9A%E7%BA%BF%E7%A8%8B/" class="tag-list-link">多线程</a><span
                    class="tag-list-count">2</span></li>
            
            
            <li class="tag-list-item"><a href="https://rulerLwx.gitee.io/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" class="tag-list-link">网络编程</a><span
                    class="tag-list-count">3</span></li>
            
        </ul>

    </div>
</div>
      
<div class="widget">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget-body">
        <ul class="recent-post-list list-unstyled no-thumbnail">
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E8%87%AA%E5%B7%B1%E5%8A%A8%E6%89%8B%E4%B8%80%E6%89%B9%E9%87%8F%E7%A7%BB%E5%8A%A8%E9%87%8D%E5%91%BD%E5%90%8D%E6%96%87%E4%BB%B6/" class="title">自己动手（一）——批量移动、重命名文件</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-27 17:50:02 &#43;0800 CST" itemprop="datePublished">2020-07-27</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E5%85%B3%E4%BA%8Einteger%E7%9A%84-128~127%E7%BC%93%E5%AD%98/" class="title">关于Integer的 -128~127缓存</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-11 16:56:21 &#43;0800 CST" itemprop="datePublished">2020-07-11</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98/" class="title">跨域问题</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-08 22:41:12 &#43;0800 CST" itemprop="datePublished">2020-07-08</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" class="title">个人博客搭建</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-05 18:58:47 &#43;0800 CST" itemprop="datePublished">2020-07-05</time>
                    </p>
                </div>
            </li>
            <li>
                <div class="item-inner">
                    <p class="item-title">
                        <a href="https://rulerLwx.gitee.io/2020/07/centos/" class="title">CentOS-</a>
                    </p>
                    <p class="item-date">
                        <time datetime="2020-07-01 18:58:47 &#43;0800 CST" itemprop="datePublished">2020-07-01</time>
                    </p>
                </div>
            </li>
        </ul>
    </div>
</div>
  </div>
</aside>

    
    
<aside class="sidebar sidebar-toc collapse" id="collapseToc" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    <h4 class="toc-title">Catalogue</h4>
    <nav id="toc" class="js-toc toc">

    </nav>
  </div>
</aside>
<main class="main" role="main"><div class="content">
  <article id="-" class="article article-type-" itemscope
    itemtype="http://schema.org/BlogPosting">
    
    <div class="article-header">
      <h1 itemprop="name">
  <a
    class="article-title"
    href="/2020/07/docker-3-%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85/"
    >Docker-3-常用软件安装</a
  >
</h1>

      <div class="article-meta">
        
<span class="article-date">
  <i class="icon icon-calendar-check"></i>&nbsp;
<a href="https://rulerLwx.gitee.io/2020/07/docker-3-%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85/" class="article-date">
  <time datetime="2020-07-01 18:58:47 &#43;0800 CST" itemprop="datePublished">2020-07-01</time>
</a>
</span>
<span class="article-category">
  <i class="icon icon-folder"></i>&nbsp;
  <a class="article-category-link" href="/categories/linux/"> Linux </a>
</span>  
  <span class="article-tag">
    <i class="icon icon-tags"></i>&nbsp;
    <a class="article-tag-link" href="/tags//">  </a>
  </span>

        <span class="post-comment"><i class="icon icon-comment"></i>&nbsp;<a href="/2020/07/docker-3-%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85/#comments"
            class="article-comment-link">Comments</a></span>
		<span class="post-wordcount hidden-xs" itemprop="wordCount">Word Count: 2567words</span>
		<span class="post-readcount hidden-xs" itemprop="timeRequired">Read Count: 6minutes </span>
      </div>
    </div>
    <div class="article-entry marked-body js-toc-content" itemprop="articleBody">
      <h1 id="redis">Redis</h1>
<p>1）拉取镜像</p>
<pre><code class="language-shell">docker pull redis:5
</code></pre>
<p>2）启动容器</p>
<p>最简单的启动</p>
<pre><code class="language-shell">docker run --name redis01 -p 6379:6379 -d redis:5 redis-server
</code></pre>
<p>复杂的启动：自定义配置文件</p>
<p>使用 <code>-v</code> 设置文件存储位置、redis配置文件位置，注意：此处映射的都是目录，不是文件（redis.conf是目录，不是文件）</p>
<p>事先创建<code>/lwx/redis/redis.conf</code>文件，再映射，就映射的是文件，而不是目录 ——20191122</p>
<pre><code class="language-shell">docker run -p 6379:6379 --name redis01 -v /lwx/redis/data:/data  -v /lwx/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf -d redis:5 redis-server /usr/local/etc/redis/redis.conf --appendonly yes
</code></pre>
<p>参考官网：https://hub.docker.com/_/redis</p>
<blockquote>
<p>总结：docker 上的 redis 默认没有配置文件（也找不到），需要我们映射后添加自己的配置文件</p>
<p>参考：https://cloud.tencent.com/developer/news/440264</p>
</blockquote>
<p>3）在宿主机的 /zzyyuse/myredis/conf/redis.conf 目录下新建 redis.conf配置文件</p>
<pre><code class="language-shell">vim /zzyyuse/myredis/conf/redis.conf/redis.conf
</code></pre>
<p>配置的内容可以从其它已安装的redis机器中拷贝过来，做适当的修改，不绑定IP等等</p>
<p>4）运行redis客户端</p>
<pre><code class="language-shell">docker exec -it 容器id redis-cli
</code></pre>
<h1 id="mysql">MySQL</h1>
<p>1）拉取镜像</p>
<pre><code class="language-shell"># docker pull mysql:5.5
</code></pre>
<p>2）启动MySQL</p>
<p>需指定密码、端口映射</p>
<p>简单启动</p>
<pre><code class="language-shell">docker run --name mysql01 -e MYSQL_ROOT_PASSWORD=123456 -d -p 3306:3306 mysql:5.5
</code></pre>
<p>复杂启动</p>
<pre><code class="language-shell">docker run -p 3306:3306 --name mysql -v /zzyyuse/mysql/conf:/etc/mysql/conf.d -v /zzyyuse/mysql/logs:/logs -v /zzyyuse/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.5
</code></pre>
<p>3）配置文件</p>
<p>在相应的目录（/zzyyuse/mysql/conf）添加配置文件</p>
<p>4）连接mysql</p>
<pre><code class="language-shell">docker exec -it MySQL容器ID /bin/bash

[root@localhost mydocker]# docker exec -it 0d702f321502  /bin/bash
root@0d702f321502:/# mysql -uroot -p
</code></pre>
<p>5）外部连接上mysql</p>
<p>使用SQLyog/Workbench等连接上mysql</p>
<p>当然了，防火墙要关掉或开放3306端口</p>
<p>Docker mysql 把数据存储在本地目录：https://blog.csdn.net/hxpjava1/article/details/78271794</p>
<p>更高级的设置：https://hub.docker.com/_/mysql</p>
<h1 id="oracle-11g">oracle-11g</h1>
<p>安装 xe 版本的oracle</p>
<p>官方文档：https://hub.docker.com/r/oracleinanutshell/oracle-xe-11g</p>
<p>1）拉取镜像</p>
<pre><code class="language-shell">docker pull oracleinanutshell/oracle-xe-11g
</code></pre>
<p>文件比较大，2.13 GB</p>
<p>2）运行镜像</p>
<pre><code class="language-shell">docker run -d -p 49161:1521 -p 8080:8080 -e ORACLE_ALLOW_REMOTE=true oracleinanutshell/oracle-xe-11g
</code></pre>
<p>映射一个目录，用来放表空间？？</p>
<pre><code>
</code></pre>
<p>3）本地（宿主机）连接</p>
<pre><code class="language-shell">[root@localhost mydocker]# docker exec -it b0ff72d71b17 bash
root@b0ff72d71b17:/# sqlplus

SQL*Plus: Release 11.2.0.2.0 Production on Fri Jul 5 15:52:42 2019

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Enter user-name: system
Enter password: 

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL&gt; 
</code></pre>
<p>4）运程连接</p>
<p>在pl/sql等工具，使用以下信息连接</p>
<pre><code class="language-tex">hostname: localhost
port: 49161
sid: xe
username: system
password: oracle
</code></pre>
<p>如</p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img-07/20200708163945.png" alt=""></p>
<p>或者</p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img-07/20200708163956.png" alt=""></p>
<p>以前企业版的连接是<code>192.168.12.132:1521/orcl</code>，而这里不写或用<code>/xe</code> ——自己的实践20190705</p>
<p>另外可以参考：</p>
<p><a href="https://www.cnblogs.com/caiyt/p/9962559.html">https://www.cnblogs.com/caiyt/p/9962559.html</a></p>
<p>5）其它</p>
<p>企业版本的安装参考：</p>
<p><a href="https://hub.docker.com/r/jaspeen/oracle-11g">https://hub.docker.com/r/jaspeen/oracle-11g</a></p>
<p><a href="https://github.com/jaspeen/oracle-11g">https://github.com/jaspeen/oracle-11g</a></p>
<p>6）示例——导入德生的 sisp 和 sisp_public</p>
<p>oracle xe 默认的表空间位置：/u01/app/oracle/oradata/XE/users.dbf，可以执行<code>SELECT * FROM Dba_Data_Files;</code>来查看表空间默认位置</p>
<p>1）创建表空间</p>
<p>pl/sql 连接上容器中的数据库后，可以在 pl/sql 中直接执行命令</p>
<p>修改路径为默认位置</p>
<pre><code class="language-sql">CREATE TABLESPACE SISP_TBS
         DATAFILE  '/u01/app/oracle/oradata/XE/SISP_TBS.DBF'
         SIZE 1024M
         AUTOEXTEND ON
         NEXT 32M MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL;

CREATE TEMPORARY TABLESPACE SISP_TMP_TBS
         TEMPFILE '/opt/sisp_data/SISP_TMP_TBS.DBF'
         SIZE 1024M
         AUTOEXTEND ON
         NEXT 32M MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL;

CREATE TABLESPACE SISP_PUBLIC_TBS
         DATAFILE  '/opt/sisp_data/SISP_PUBLIC_TBS.DBF'
         SIZE 1024M
         AUTOEXTEND ON
         NEXT 32M MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL;

CREATE TEMPORARY TABLESPACE SISP_PUBLIC_TMP_TBS
         TEMPFILE '/opt/sisp_data/SISP_PUBLIC_TMP_TBS.DBF'
         SIZE 1024M
         AUTOEXTEND ON
         NEXT 32M MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL;
</code></pre>
<p>2）创建用户</p>
<pre><code class="language-sql">CREATE USER  sisp   IDENTIFIED BY  sisp
 DEFAULT TABLESPACE SISP_TBS
 TEMPORARY TABLESPACE SISP_TMP_TBS
 PROFILE DEFAULT
 QUOTA  UNLIMITED ON SISP_TBS;
 
GRANT  CONNECT         TO  sisp   WITH ADMIN OPTION;
GRANT  resource        TO  sisp  ; 
GRANT  CREATE SESSION  TO  sisp ;

grant  debug connect session to  sisp ;
 
GRANT CREATE DATABASE LINK TO sisp ;
GRANT CREATE PUBLIC DATABASE LINK TO  sisp ;

grant drop PUBLIC DATABASE LINK TO  sisp;
grant create SYNONYM  to sisp;
grant create view to  sisp;
grant create materialized view to sisp;
grant create job to sisp;
grant create trigger to sisp;
grant create any directory to sisp;
grant create sequence to sisp;
grant dba to sisp;

ALTER USER sisp  TEMPORARY TABLESPACE SISP_TMP_TBS;
ALTER USER sisp  QUOTA UNLIMITED ON   SISP_TBS;

-- drop user &amp;user_name cascade;
----------------------SISP_PUBLIC----------------------------------------------

CREATE USER  sisp_public   IDENTIFIED BY  sisp_public
 DEFAULT TABLESPACE SISP_PUBLIC_TBS
 TEMPORARY TABLESPACE SISP_PUBLIC_TMP_TBS
 PROFILE DEFAULT
 QUOTA  UNLIMITED ON SISP_PUBLIC_TBS;
 
GRANT  CONNECT         TO  sisp_public   WITH ADMIN OPTION;
GRANT  resource        TO  sisp_public  ; 
GRANT  CREATE SESSION  TO  sisp_public ;

grant  debug connect session to  sisp_public ;
 
GRANT CREATE DATABASE LINK TO sisp_public ;
GRANT CREATE PUBLIC DATABASE LINK TO  sisp_public ;

grant drop PUBLIC DATABASE LINK TO  sisp_public;
grant create SYNONYM  to sisp_public;
grant create view to  sisp_public;
grant create materialized view to sisp_public;
grant create job to sisp_public;
grant create trigger to sisp_public;
grant create any directory to sisp_public;
grant create sequence to sisp_public;
grant dba to sisp_public;

ALTER USER sisp_public  TEMPORARY TABLESPACE SISP_TMP_TBS;
ALTER USER sisp_public  QUOTA UNLIMITED ON   SISP_TBS;

-- drop user &amp;sisp_public cascade
</code></pre>
<p>3）导入 dmp</p>
<p>在 docker 上启动容器，将 dmp 上传到容器目录中，这里是 /opt</p>
<p>执行命令：</p>
<pre><code class="language-shell">root@ce1231e36282:/opt# imp sisp/sisp@xe file=./sisp_71_20150820.dmp full=y
root@ce1231e36282:/opt# imp sisp_public/sisp_public@xe file=./sisp_public_71_20150820.dmp full=y
</code></pre>
<h1 id="nginx">Nginx</h1>
<pre><code class="language-shell">docker run --name nginx01 -p 80:80 -v /some/content:/usr/share/nginx/html:ro -d nginx:stable
</code></pre>
<p>指定配置文件目录、静态文件目录、日志目录的安装，TODO&hellip;</p>
<p>思路：先安装一个简易的、默认的nginx容器，目的是从这个容器中拿到nginx的默认配置</p>
<p>步骤一：复制nginx.conf，复制到事先创建好的目录</p>
<pre><code>$ docker run --name tmp-nginx-container -d nginx
$ docker cp tmp-nginx-container:/etc/nginx/nginx.conf /lwx/nginx/nginx.conf
$ docker rm -f tmp-nginx-container
</code></pre>
<p>参考：https://www.runoob.com/docker/docker-install-nginx.html</p>
<p>步骤二：创建容器，<code>-v /lwx/nginx/nginx.conf:/etc/nginx/nginx.conf:ro</code>是文件映射，不是目录</p>
<pre><code class="language-shell">docker run --name nginx01 -p 8081:80 -v /lwx/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -v /lwx/nginx/html:/usr/share/nginx/html:ro -d nginx:stable
</code></pre>
<p>要事先将<code>nginx.conf</code>配置文件复制到<code>/lwx/nginx/</code>下，这样用<code>-v</code>映射的就是文件，而不是目录 ——20191120</p>
<p><strong>总结：</strong> 配置文件映射后，在配置文件中写的路径不是宿主机的路径，而是容器中的路径，将宿主机的路径嵌入容器中来写 ——20191031</p>
<p>还是复制原生的配置文件比较靠谱，不能随便拷贝其它的配置，例如拷贝下面的，将启动不想来：</p>
<pre><code>user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '
                      '$status $body_bytes_sent &quot;$http_referer&quot; '
                      '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    #include /etc/nginx/conf.d/*.conf;
    server {
        listen       80;
        server_name  localhost;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;

        location / {
                ssi on;
        	ssi_silent_errors on;
        	ssi_types text/shtml;
            	root           /usr/share/nginx/html; #重点
            	index          index.html; #重点，可以在前面加上相对路径
        }
    }
}
</code></pre>
<h1 id="rabbitmq">rabbitmq</h1>
<p>参考：https://www.cnblogs.com/yufeng218/p/9452621.html</p>
<pre><code class="language-shell">docker pull rabbitmq:3.7.17-management

docker run -d --name rabbitmq3.7.17 -p 5672:5672 -p 15672:15672 -v /myrabit/data:/var/lib/rabbitmq --hostname myRabbit -e RABBITMQ_DEFAULT_VHOST=my_vhost  -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin rabbitmq:3.7.17-management
</code></pre>
<p>关于<code>docker run</code>的说明：</p>
<ul>
<li>-d 后台运行容器；</li>
<li>&ndash;name 指定容器名；</li>
<li>-p 指定服务运行的端口（5672：应用访问端口；15672：控制台Web端口号）；</li>
<li>-v 映射目录或文件；</li>
<li>&ndash;hostname  主机名（RabbitMQ的一个重要注意事项是它根据所谓的 “节点名称” 存储数据，默认为主机名）；</li>
<li>-e 指定环境变量；（RABBITMQ_DEFAULT_VHOST：默认虚拟机名；RABBITMQ_DEFAULT_USER：默认的用户名；RABBITMQ_DEFAULT_PASS：默认用户名的密码）</li>
</ul>
<p>使用浏览器打开web管理端：http://Server-IP:15672</p>
<h1 id="tomcat">Tomcat</h1>
<pre><code>docker run -d --name tomcat01 -p 8888:8080 tomcat:9
</code></pre>
<h1 id="其它常用软件镜像">其它常用软件镜像</h1>
<pre><code class="language-shell">docker pull wnameless/oracle-xe-11g
docker pull mongo
docker pull redis:2.8.21
docker pull cloudesire/activemq
docker pull rabbitmq
docker pull rabbitmq:3-management
</code></pre>
<p>有些镜像可以在阿里云上搜索</p>
<p><img src="https://gitee.com/rulerLwx/PicGo/raw/master/img-07/20200708164055.png" alt=""></p>
<h1 id="faq">FAQ</h1>
<h2 id="已经执行了-docker-run-后的容器如何修改配置如添加或修改目录映射">已经执行了 docker run 后的容器，如何修改配置，如：添加或修改目录映射？</h2>
<ul>
<li>方法一：docker update &ndash;xxx 容器ID</li>
<li>方法二：直接修改容器配置文件：/var/lib/docker/containers/xxxxxxx/hostconfig.json</li>
</ul>
<p>总结：方法一，参数有限；方法二，我觉得不好修改 ——20191031</p>
<p>参考：</p>
<ul>
<li><a href="https://blog.csdn.net/chouzhou9701/article/details/86725203">https://blog.csdn.net/chouzhou9701/article/details/86725203</a></li>
<li><a href="https://www.cnblogs.com/zhuochong/p/10070516.html">https://www.cnblogs.com/zhuochong/p/10070516.html</a></li>
</ul>

    </div>
    <div class="article-footer">
<blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">
    <li class="post-copyright-link hidden-xs">
      <strong>Permalink: </strong>
      <a href="https://rulerLwx.gitee.io/2020/07/docker-3-%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85/" title="Docker-3-常用软件安装" target="_blank" rel="external">https://rulerLwx.gitee.io/2020/07/docker-3-%E5%B8%B8%E7%94%A8%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85/</a>
    </li>
    <li class="post-copyright-license">
      <strong>License：</strong><a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN</a>
    </li>
  </ul>
</blockquote>

<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://gitee.com/rulerLwx" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="https://rulerLwx.gitee.io/avatar.png" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://gitee.com/rulerLwx" target="_blank"><span class="text-dark">rulerLwx</span><small class="ml-1x">thinking...</small></a></h3>
        <div>Good Good Study, Day Day Up~</div>
      </div>
    </figure>
  </div>
</div>
    </div>
  </article>
<section id="comments">
    <div id="vcomments"></div>
</section>

</div><nav class="bar bar-footer clearfix" data-stick-bottom>
    <div class="bar-inner">
        <ul class="pager pull-left">
            <li class="prev">
                <a href="https://rulerLwx.gitee.io/2020/07/docker-4-%E6%88%91%E7%9A%84dockerfile/" title="Docker-4-我的dockerfile"><i
                        class="icon icon-angle-left"
                        aria-hidden="true"></i><span>&nbsp;&nbsp;Older</span></a>
            </li>
            <li class="next">
                <a href="https://rulerLwx.gitee.io/2020/07/docker-2-%E7%BD%91%E7%BB%9C/"
                    title="Docker-2-网络"><span>Newer&nbsp;&nbsp;</span><i
                        class="icon icon-angle-right" aria-hidden="true"></i></a>
            </li>
            
            <li class="toggle-toc">
                <a class="toggle-btn collapsed" data-toggle="collapse" href="#collapseToc" aria-expanded="false"
                    title="Catalogue" role="button">
                    <span>[&nbsp;</span><span>Catalogue</span>
                    <i class="text-collapsed icon icon-anchor"></i>
                    <i class="text-in icon icon-close"></i>
                    <span>]</span>
                </a>
            </li>
        </ul>
        <div class="bar-right">
            <div class="share-component" data-sites="weibo,qq,wechat"
                data-mobile-sites="weibo,qq,qzone"></div>
        </div>
    </div>
</nav>

</main><footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
<ul class="social-links">
    <li><a href="https://gitee.com/rulerLwx" target="_blank" title="gitee" data-toggle=tooltip data-placement=top >
            <i class="icon icon-gitee"></i></a></li>
    <li><a href="https://github.com/wolf-lea" target="_blank" title="github" data-toggle=tooltip data-placement=top >
            <i class="icon icon-github"></i></a></li>
</ul>
  <div class="copyright">
    &copy;2020  -
    2020
    <div class="publishby">
        Theme by <a href="https://github.com/xiaoheiAh" target="_blank"> xiaoheiAh </a>base on<a href="https://github.com/xiaoheiAh/hugo-theme-pure" target="_blank"> pure</a>.
    </div>
  </div>
</footer>

<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_SVG"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
            showMathMenu: false, //disables context menu
            tex2jax: {
            inlineMath: [ ['$','$'], ['\\(','\\)'] ]
           }
    });
</script>


<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
<script>
    window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>
<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/highlight.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/python.min.js" defer></script>
<script type="text/javascript" src="https://cdn.staticfile.org/highlight.js/9.15.10/languages/javascript.min.js" defer></script><script>
    hljs.configure({
        tabReplace: '    ', 
        classPrefix: ''     
        
    })
    hljs.initHighlightingOnLoad();
</script>
<script src="https://rulerLwx.gitee.io/js/application.min.bdeb64b910570b6c41badc6a05b7afb0c8ad9efd8525de3c7257d59e786326a3.js"></script>
<script src="https://rulerLwx.gitee.io/js/plugin.min.51ff8c7317566f82259170fa36e09c4493adc9b9378b427a01ad3f017ebac7dd.js"></script>

<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            ROOT_URL: 'https:\/\/rulerLwx.gitee.io',
            CONTENT_URL: 'https:\/\/rulerLwx.gitee.io\/searchindex.json ',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script type="text/javascript" src="https://rulerLwx.gitee.io/js/insight.min.a343cd9a5a7698336b28ef3a7c16a3a1b1d2d5fb17dc8ed04022bbe08cc5459073a15bdafa3a8a58cdd56080784bdd69fa70b1ae8597565c799c57ed00f0e120.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.min.js"></script>
<script>
    tocbot.init({
        
        tocSelector: '.js-toc',
        
        contentSelector: '.js-toc-content',
        
        headingSelector: 'h1, h2, h3',
        
        hasInnerContainers: true,
    });
</script>

<script src="https://cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine"></script>
<script type="text/javascript">
    var GUEST = ['nick', 'mail', 'link'];
    var meta = 'nick,mail';
    meta = meta.split(',').filter(function (item) {
        return GUEST.indexOf(item) > -1;
    });
    new Valine({
        el: '#vcomments',
        verify: null ,
        notify: null ,
        appId: 'IyAB0PSPRazTPDxitO1ddQ7O-gzGzoHsz',
        appKey: '5rBJTq4KidYF33eXwvRVhtEH',
        placeholder: 'enjoy~',
        avatar: 'mm',
        meta: meta,
        pageSize: '10' || 10,
        visitor: false 
});
</script>

  </body>
</html>
